<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>个人信息及密码修改</title>
    <link rel="stylesheet" href="__PUBLIC__/Home/css/personCenter/personInfo.css">
    <script src="__PUBLIC__/Home/js/personCenter/jquery-2.1.3.min.js" charset="utf-8"></script>
    <style media="screen">
      span{
        font-size: 13px;
      }
    </style>
  </head>
  <body>
    <div id="myinfo">
        <p style="margin-top: 20px;height:28px;">
          <span class="myinformation">我的个人信息</span>
          <span class="infoinput">请填写以下信息*为必填项</span>
        </p>
        <form class="" action="{:U('personCenter/personInfoAdd')}" method="post">
          <input type="hidden" name="user_id" value="{$ulist.user_id}">
          <label class="mylaber">*电子邮件地址</label>
          <div class="myinput">
            <input type="text" name="email" class="myform" placeholder="*电子邮件" id="email">
            <span id="emailtips" style="color:red"></span>
          </div>
          <label class="mylaber">*用户名</label>
          <div class="myinput">
            <input type="text" name="username" class="myform" placeholder="*用户名" id="username" value="{$ulist.username}" readonly>
            <span id="usernametips" style="color:red"></span>
          </div>
          <label class="mylaber">*真实姓名</label>
          <div class="myinput">
            <input type="text" name="real_name" class="myform" placeholder="*真实姓名" id="real_name">
            <span id="real_nametips" style="color:red"></span>
          </div>
          <label class="mylaber">*手机</label>
          <div class="myinput">
            <input type="text" name="tel" class="myform" placeholder="*手机" id="tel">
            <span id="teltips" style="color:red"></span>
          </div>
          <label class="mylaber">*性别</label>
          <div class="myinput">

            <input type="radio" class="mysex" name="sex" checked value="0">
            <span class="choosesex">女</span>
            <input type="radio" class="mysex" name="sex" value="1">
            <span class="choosesex">男</span>
          </div>
          <label class="mylaber">*出生日期</label>
          <div style="height:40px;">
              <!-- 出生年选择 -->
              <div class="myage">
                <select class="agedetail sel_year" name="year">
                </select>
              </div>
              <div class="myage">
                <select class="agedetail sel_month" name="month" style="padding-left:15px">
                </select>
              </div>
              <div class="myage">
                <select class="agedetail sel_day"  name="day" style="padding-left:15px">
                </select>
              </div>
              <!-- 清除浮动 -->
              <div style="clear:both"></div>
              <hr style="margin:30px 0;opacity:0.7">
              <div style="height:46px;margin-top:10px;float:left" class="myinput">
                  <input type="submit" value="确定" style="width:160px;height:46px;background:#025f8e;color:white;border:none;cursor:pointer">
              </div>
          </div>
          <div style="clear:both"></div>
        </form>
    </div>
  </body>
  <script type="text/javascript" src="__PUBLIC__/Home/js/personCenter/birthday.js"></script>
  <script>
  // 验证码动态刷新
  function changecode(){
    var url = "{:U('personCenter/myverify')}";
    console.log(url);
    $('#vdimgck').attr('src',url);
  }
  // 出生年月的js
  $(function () {
  	$.ms_DatePicker({
        YearSelector: ".sel_year",
        MonthSelector: ".sel_month",
        DaySelector: ".sel_day"
      });
  	$.ms_DatePicker();
  });
  // 用分针自动获取其子窗口的高
  window.onload = function(){
    var mywidth=document.body.scrollHeight;
    top.document.getElementById('show').innerHTML = mywidth;
    top.back();
  };



  // js页面验证提交的信息
  $(function(){
    var k1 = false;
    var k2 = false;
    var k3 = false;
    var k4 = false;
    //1.验证邮箱
    var reg5= /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    $("#email").on("blur",function(){
        if(!reg5.test($(this).val())){
            $("#emailtips").html("邮箱格式错误");
        }else{
            $("#emailtips").html("");
            k1 = true;
        }
    });
    /* 2 .用户名 */
    var reg1= /^[A-Za-z][A-Za-z0-9-_]{4,16}$/;
    $("#username").on("blur",function(){
        if(!reg1.test($(this).val())){
            $("#usernametips").html("请输入5-16位用户名");
        }else{
            $("#usernametips").html("");
            k2 = true;
        }
    });
    /*3 .真实姓名验证*/
    var reg3= /^[\u4e00-\u9fa5]{2,12}$/;
    $("#real_name").on("blur",function(){
        if(!reg3.test($(this).val())){
            $("#real_nametips").html("请输入2-12个中文");
        }else{
            $("#real_nametips").html("");
            k3= true;
        }
    });
    /*4 .手机号验证*/
    var reg2= /^1[35689]\d{9}$/;
    $("#tel").on("blur",function(){
        if(!reg2.test($(this).val())){
            $("#teltips").html("请输入13位手机号码");
        }else{
            $("#teltips").html("");
            k4 = true;
        }
    });

    $('#submit').on('click',function(){
          if(k1 == true && k2 == true && k3 == true && k4 == true){
          }else{
            return false;
          }
    });
  });

  </script>
</html>
